home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
NEXTSUBA.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
1KB
|
45 lines
/************************************************************************************/
/* NextSubAndPosit */
/* */
/* This procedure returns the first available subscript int the windTbl, and the */
/* next position which should be used for a new window. */
/* */
/* Note. This routine will not look at positions 0 or 1 in windTbl, since they */
/* are reserved for the main window and a help window. */
/************************************************************************************/
#include "MyHeaders.h"
int NextSubAndPosit (Point * nextPosit)
{
int NSRetCode = 0;
windSub = 0;
for (j=2; j<windMax; j++) /* find the first empty pointer in windTbl */
{
if (windTbl[j].windPtr == 0)
{
windSub = j;
break;
}
}
if (windSub == 0)
{ /* if no empty pointer was found */
NSRetCode = 1; /* set a bad return code */
goto ENDING; /* and get out */
}
(*nextPosit).v +=20; /* incr vertical position */
if ((*nextPosit).v > (screenBits.bounds.bottom - 225)) /* if too far down */
(*nextPosit).v = 40; /* reset near top */
(*nextPosit).h +=10; /* incr horizontal position */
if ((*nextPosit).h > (screenBits.bounds.right - 345)) /* if too far right */
(*nextPosit).h = 10; /* reset near left */
ENDING:
return NSRetCode;
}